package com.sparrow.common.metric.domain;

import java.util.concurrent.atomic.AtomicLong;

public class Counter {

    private final String name;
    private final AtomicLong value = new AtomicLong(0);

    public Counter(String name) {
        this.name = name;
    }

    public String getName() { return name; }

    public long increment() {
        return value.incrementAndGet();
    }

    public void add(long delta) { value.addAndGet(delta); }

    public long get() { return value.get(); }

    public void reset() { value.set(0); }



}